package com.qs.education.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationClassBean;
import com.qs.education.bean.entity.EducationClass;
import com.qs.education.bean.service.BaseService;
import com.qs.education.service.IClassAPIService;
import org.springframework.beans.BeanUtils;

/**
 * @class ClassAPIServiceImpl
 * @author Leon
 * @description
 * @date Nov 8, 2018
 */
@Service
public class ClassAPIServiceImpl  extends BaseService implements IClassAPIService{

	@Override
	public ResponseListBean<EducationClassBean> getAllClass() {
		List<EducationClass> list = iEducationClassDao.getAll(EducationClass.class);
		ResponseListBean<EducationClassBean> listClass = new ResponseListBean<EducationClassBean>();
		for(EducationClass clazz : list ) {
			EducationClassBean bean = new EducationClassBean();
			BeanUtils.copyProperties(clazz,bean);
			listClass.getList().add(bean);
		}
		return listClass;
	}
}
